#include "../src/thread.h"

#include"somme.h"

#define NB_TEST 2
float RESULTS_TIME[NB_TEST];
float RESULTS_THREAD[NB_TEST];


void test (int nb_thread, int running_test){
	float*r = somme_finale(nb_thread);
	RESULTS_TIME[running_test]  = r[0];
	RESULTS_THREAD[running_test] = r[1];
}

void ecrire_fichier(char* Name){
	int i;
	int f = fopen(Name, "w+" ) ; 
	fprintf(f,"time nombre_thread\n");
	for (i=0; i<NB_TEST;i++){
		fprintf(f,"%g %g\n",RESULTS_TIME[i],RESULTS_THREAD[i]);
	}
	close(f);
}



int main (int argc,char **argv){
  	int i = 0;
  	int nb_thread=0;
  	
  	for (i=0; i<NB_TEST; i++){
  		printf("Entrer un entier : \n");
  		scanf("%d", &nb_thread);
  		test(nb_thread,i);
  	}
  		ecrire_fichier("test_somme.txt"); 	
  	return EXIT_SUCCESS;
}
